package com.k2.whereareyou.engine;

import com.k2.whereareyou.xml.FrendXMLAnsver;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class DataAdapterFrend extends BaseAdapter{
	
	private FrendXMLAnsver[] listFrends;
    Context mContext;
    
    public DataAdapterFrend(Context context, int resource, FrendXMLAnsver[] listFrends) {
        this.mContext = context;
        this.listFrends = listFrends;
    }
        
    public View getView(int position, View convertView, ViewGroup parent) {
    	
        TextView label; 
            
        if (convertView == null) {
            label = new TextView(mContext);
            label.setTextSize(20);
        }
        else
        	label = (TextView) convertView;
        label.setText(listFrends[position].getNickname());          
        return label;
        }

    public int GetItem(int position) {
        return position;
    }

	@Override
	public int getCount() {
		return listFrends.length;
	}

	@Override
	public Object getItem(int position) {
		return position;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}
}
